<?php

$lang_from_to = str_replace("<#1>", "1.0.6", $lang_update['update_from_to']);
$lang_from_to = str_replace("<#2>", "1.0.7", $lang_from_to);

if($_GET['step']=="2"){
	mysql_query("UPDATE {$db_prefix}settings SET max_version='$ver_name'");
	mysql_query("ALTER TABLE `{$db_prefix}settings` ADD `like_facebook_post` INT( 11 ) NOT NULL DEFAULT '1';");
	mysql_query("ALTER TABLE `{$db_prefix}settings` ADD `share_post` INT( 11 ) NOT NULL DEFAULT '1';");
	mysql_query("ALTER TABLE `{$db_prefix}settings` ADD `active_fb` INT( 11 ) NOT NULL DEFAULT '1';");
	mysql_query("ALTER TABLE `{$db_prefix}settings` ADD `fb_id` VARCHAR( 255 ) NOT NULL ;");
	mysql_query("ALTER TABLE `{$db_prefix}settings` ADD `fb_secr` VARCHAR( 255 ) NOT NULL ;");
	mysql_query("ALTER TABLE `{$db_prefix}settings` ADD `menu_block` INT( 11 ) NOT NULL DEFAULT '1';");
	mysql_query("ALTER TABLE `{$db_prefix}posts` ADD `icons` INT( 11 ) NOT NULL ;");

	$array_table = array(
		"Like_facebook_post ".$lang_update['upd_done']."",
		"Share_post ".$lang_update['upd_done']."",
		"Active_fb ".$lang_update['upd_done']."",
		"Fb_secr ".$lang_update['upd_done']."",
		"Fb_id ".$lang_update['upd_done']."",
		"Menu_block ".$lang_update['upd_done']."",
		"Icons ".$lang_update['upd_done']."",
		"Fb_id ".$lang_update['upd_done'].""
	);
	
	$html_ok = "<form method='post' onsubmit='return check_license()' action='upgrade.php'>";
	$html_ok .= "<br /><br /><div style='font: 16px Arial; font-weight: bold;'>";
	$html_ok .= "<center><input type='submit' class='img-submit' value='".$lang['submit_ok']."'/></center>";
	$html_ok .= "</form>";
	
}else{
	echo "<form method='post' onsubmit='return check_license()' action='upgrade.php?step=2'>";
	echo "<br /><br /><br /><br /><div style='font: 16px Arial; font-weight: bold;'>";
	echo "<center>".$lang_from_to."</center></div><br /><br /><br /><br />";
	echo "<input type='hidden' name='ver_name' value='1.0.7'/><div>";
	echo "<center><input type='submit' class='img-submit' value='".$lang['submit_ok']."'/></center>";
	echo "</form>";
}
?>